<?php
// +----------------------------------------------------------------------
// | KITEGO-Admin「开箱即用」「人人全栈」
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.kitego.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed KITEGO并不是自由软件，未经许可不能去掉KITEGO相关版权
// +----------------------------------------------------------------------
// | Author: KITEGO Team <bd@kitego.cn>
// +----------------------------------------------------------------------

namespace app\adminapi\validate\maintenance;

use think\Validate;

class LangTranslationValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'sort|排序' => 'require|number',
        'originalText|原文' => 'require',
        'isDelete|是否删除' => ['require', 'in' => '0, 1'],
        'translationList|译文列表' => ['require', 'array'],
        'scene|翻译场景' => ['require', 'in' => '1,2'],
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [];

    /**
     * 验证场景定义
     * @var array
     */
    protected $scene = [
        'edit' => ['sort', 'originalText', 'translationList', 'isDelete', 'scene']
    ];
}
